#pragma once
#include "Map.h"

enum actionType{MOVE,ATTACK,UNKNOWN};

class Action
{
public:
	Action(void);
	~Action(void);
	virtual int getTrame(char* buffer)=0;// rempli le buffer et renvoie la longueur
	virtual void apply(Map &map)=0;
	actionType type;
	virtual void printAction()=0;
};

class Attack:public Action
{
public:
	Attack();
	Attack(int X,int Y, Race tPlayer);
	~Attack();
	int getTrame(char* buffer);
	void apply(Map &map);
	void printAction();

	void combine(Action* action){};

private:
	int targetX;
	int targetY;
	Race currentPlayer;
};

class Move:public Action
{
public:
	Move();
	Move(int numMoves,int fromX[3],int fromY[3],int toX[3],int toY[3],int numIndividual[3]);
	~Move();
	int getTrame(char* buffer);
	void apply(Map &map);
	int getNumMoves();
	std::vector<int> getFromX();
	std::vector<int> getFromY();
	std::vector<int> getToX();
	std::vector<int> getToY();
	std::vector<int> getNumIndividual();
	void printAction();
	void combine(Action* action);


private:
	int numMoves;
	int fromX[3];
	int fromY[3];
	int toX[3];
	int toY[3];
	int numIndividual[3];
};



